package com.test.ml.exception;

import java.util.HashMap;
import java.util.Map;

import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice(annotations=RequestMapping.class)
public class Exceptionhander {
	@ExceptionHandler
	@ResponseBody
	public Object exceptionHander(Exception e){
		Map<String,Object> msg=new HashMap<>();
		msg.put("sucess", 2);
		msg.put("msg", e.getMessage());
		e.printStackTrace();
		return msg;
	}
}
